<!-- 精选课程 -->
<template>
	<div class="choiceness">
		<div class="page_content">
			<div class="choiceness__tab df ac">
				<img src="@/assets/images/jingx.png" alt=""> 精选课程
			</div>
			<div class="df ffrw" v-if="list.length > 0" >
				<xy-course-item v-for="item in list" :item="item" :key="item.id"> </xy-course-item>
			</div>
			<xy-empty style="--empty-width:200px;--empty-tb:0" v-else v-loading="loading"></xy-empty>
		</div>
	</div>
</template>

<script setup lang="ts">
import api from '@/api/api';
//组件命名-----
defineOptions({ name: "choiceness-item-index" })
const list = ref<any>([])
const loading = ref(false)

/**
 * 获取课程列表
 */
const GetCourseList = async () => {
	loading.value = true
	const res = await api.GetindexContent_API()
	if (res.code == 0) {
		list.value = res.data.selectedCourseVos
	}
	loading.value = false
}
onMounted(() => {
	GetCourseList()
})
</script>

<style lang="scss" scoped>
.choiceness {
	background-color: #F7F8FA;
	padding-bottom: 30px;

	&__tab {
		padding: 30px 0;
		font-size: 24px;

		img {
			width: 26px;
			height: 24px;
			margin-right: 10px;
		}
	}
}
</style>
